package cn.zane.principle.richterSubstitutionPrinciple.design;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: zane
 * @Date: 2024/12/16
 * @Description: 储蓄卡
 */
@Slf4j
public class CashCard extends BankCard {

    public CashCard(String cardNo,String cardDate){
        super(cardNo,cardDate);
    }

    @Override
    boolean rule(BigDecimal amount) {
        return true;
    }

    public String withdrawal(String orderId, BigDecimal amount) {
        log.info("提现成功，单号:{} 金额:{}", orderId, amount);
        return super.negative(orderId, amount);
    }

    public String recharge(String orderId, BigDecimal amount) {
        log.info("储蓄成功，单号:{} 金额:{}", orderId, amount);
        return super.positive(orderId, amount);
    }

    @Override
    public List<String> tradeFlow() {
        return super.tradeFlow();
    }
}
